﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DesignPatterns.TemplateMethod
{
    public partial class FrmTemplateMethod : FrmBase
    {
        public FrmTemplateMethod()
        {
            InitializeComponent();

            btnReadTestPaper.Click += BtnReadTestPaper_Click;
        }

        private void BtnReadTestPaper_Click(object sender, EventArgs e)
        {
            labResult.Text = "";
            labResult.Text += "学生甲抄的试卷：";
            var testPaperA = new TestPaperA();
            labResult.Text += "\n";
            labResult.Text += testPaperA.TestQuestion1();
            labResult.Text += "\n";
            labResult.Text += testPaperA.TestQuestion2();
            labResult.Text += "\n";
            labResult.Text += testPaperA.TestQuestion3();

            labResult.Text += "\n\n";
            labResult.Text += "学生乙抄的试卷：";
            var testPaperB = new TestPaperB();
            labResult.Text += "\n";
            labResult.Text += testPaperB.TestQuestion1();
            labResult.Text += "\n";
            labResult.Text += testPaperB.TestQuestion2();
            labResult.Text += "\n";
            labResult.Text += testPaperB.TestQuestion3();
        }
    }
}
